home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / ATEXIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  618 b   |  27 lines

  1. /* atexit.c --- BIBLE pp. 76-77 */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. main(int argc, char **argv)
  5. {
  6.     atexit_t first, second, third;
  7.     atexit(first);
  8.     atexit(second);
  9.     atexit(third);
  10.     printf("Now exiting...\n");
  11. }
  12.                 /* ------------------------------- */
  13. atexit_t first(void)
  14. {
  15.     printf("Function number 1:  called last\n");
  16. }
  17.                 /* --------------------------------- */
  18. atexit_t second(void)
  19. {
  20.     printf("Function number 2:\n");
  21. }
  22.                 /* --------------------------------- */
  23. atexit_t third(void)
  24. {
  25.     printf("Function number 3:  called first\n");
  26. }
  27.                 /* --------------------------------- */